package com.future.mayi.response;


import android.text.TextUtils;

import com.future.baselib.entity.BaseResponse;
import com.future.mayi.app.App;
import com.future.mayi.model.OrderNumModel;
import com.future.mayi.model.UserInfoModel;

import org.json.JSONException;
import org.json.JSONObject;


public class UserInfoResponse extends BaseResponse {


    public UserInfoModel userInfoModel;
    public int msg_num;
    public int cart_num;

    @Override
    public void parseInfo(String content) throws JSONException {
        if (!TextUtils.isEmpty(content)) {
            JSONObject object = new JSONObject(content);
            msg_num= object.optInt("msg_num");
            cart_num= object.optInt("cart_num");
            String userinfo = object.optString("userinfo");
            if (!TextUtils.isEmpty(userinfo))
                userInfoModel = App.getGson().fromJson(userinfo, UserInfoModel.class);
        }
    }
}
